﻿<%@ Page Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeFile="ProductStore.aspx.cs" Inherits="Manager_ProductStore_ProductStore" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript" language="javascript" src="../../Pub/Js/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="../../Pub/Js/jquery.easydrag.handler.beta2.js"></script>
<table border="1" bordercolor="#407db3" cellpadding="2" cellspacing="2" class="tbl_Comon-Search"
        style="border-collapse: collapse; margin-left: 0px; width: 100%;" width="100%">
        <tr>
            <td align="center" nowrap="nowrap" rowspan="2" valign="middle" style="width: 4%">
                <asp:Button ID="btnSearch" runat="server" CssClass="cssButton" Text="Tìm kiếm" Width="80px"
                    OnClick="btnSearch_Click" /></td>
            <td nowrap="nowrap" style="width: 10%; white-space: nowrap;" class="td_Title">
                <asp:Label ID="Label1" runat="server" CssClass="lbl_Common-Search" Text="Tên sản phẩm"></asp:Label></td>
            <td nowrap="nowrap" class="td_Control">
                <asp:TextBox ID="txtTenSP" runat="server" Height="20px" Width="98%" CssClass="txt_Product"></asp:TextBox></td>
            <td nowrap="nowrap" class="td_Title" style="width: 10%; white-space: nowrap;">
                <asp:Label ID="Label2" runat="server" CssClass="lbl_Common-Search" Text="Chủ đề"></asp:Label></td>
            <td nowrap="nowrap" class="td_Control">
                <asp:DropDownList ID="ddlChuDe" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlChuDe_SelectedIndexChanged">
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td nowrap="nowrap" class="td_Title" style="width: 10%; white-space: nowrap;">
                <asp:Label ID="Label4" runat="server" CssClass="lbl_Common-Search" Text="Kho"></asp:Label></td>
            <td nowrap="nowrap" class="td_Control">
                <asp:DropDownList ID="ddlStore" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlStore_SelectedIndexChanged" >
                </asp:DropDownList></td>
            <td class="td_Title" nowrap="nowrap" style="width: 10%; white-space: nowrap">
                <asp:Label ID="Label3" runat="server" CssClass="lbl_Common-Search" Text="Thể loại"></asp:Label></td>
            <td class="td_Control" nowrap="nowrap">
                <asp:DropDownList ID="ddlTheLoai" runat="server">
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td align="right" colspan="5" nowrap="nowrap" valign="top" style="visibility:hidden;display:none">
                <asp:Label ID="lblCountStore" runat="server" style="color: #330066"></asp:Label></td>
        </tr>
    </table>
    <br />
    <asp:GridView ID="grv_Master" runat="server" CellPadding="3" BorderColor="#407DB3"
        BorderWidth="1px" AutoGenerateColumns="False" Width="100%" AllowPaging="True" OnPageIndexChanging="grv_Master_PageIndexChanging" PageSize="20" OnRowDataBound="grv_Master_RowDataBound" >
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    Mã Sản phẩm
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("PDID") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Center"  Width="1%" Wrap="False" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Tên Sản phẩm
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label23" runat="server" Text='<%# Eval("PDName") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" />
                <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Left" Width="40%"  />
            </asp:TemplateField>     
            <asp:TemplateField>
                <HeaderTemplate>
                    Giá bán ra
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price") %>'></asp:Label>
                    <asp:Label ID="Label6" runat="server" Text='<%# Eval("Rate") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv"  HorizontalAlign="Right" Wrap="false"/>
                <HeaderStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="1%" Wrap="false"  />
            </asp:TemplateField>            
            <asp:TemplateField>
                <HeaderTemplate>
                Còn lại
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblQuantityStore" runat="server" Text='' Font-Bold="true"></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                <HeaderStyle CssClass="cssBorderGrv" Width="1%"  Wrap="False" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Chủ đề-Thể loại
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label55" runat="server" Text='<%# Eval("TopicName") %>'></asp:Label> - <asp:Label ID="Label5" runat="server" Text='<%# Eval("CatName") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" Width="10%" />
                <HeaderStyle CssClass="cssBorderGrv" Wrap="false" />
            </asp:TemplateField> 
           <asp:TemplateField>
                <HeaderTemplate>
                   Chi tiết
                </HeaderTemplate>
                <ItemTemplate>
                  
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                <HeaderStyle CssClass="cssBorderGrv" Width="1%" Wrap="False"  />
            </asp:TemplateField>     
           <asp:TemplateField>
                <HeaderTemplate>
                   Nhập 
                </HeaderTemplate>
                <ItemTemplate>
                    
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                <HeaderStyle CssClass="cssBorderGrv" Width="1%" Wrap="False"  />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Xuất 
                </HeaderTemplate>
                <ItemTemplate>   
                       
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                <HeaderStyle CssClass="cssBorderGrv" Width="1%" Wrap="False" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Giá gốc
                </HeaderTemplate>
                <ItemTemplate>   
                       
                </ItemTemplate>
                <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                <HeaderStyle CssClass="cssBorderGrv" Width="1%" Wrap="False" />
            </asp:TemplateField>
        </Columns>
        <RowStyle CssClass="gvRowStyle" />
        <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
        <HeaderStyle CssClass="gvHeader" />
        <PagerStyle CssClass="gvPaggingStyle" />
    </asp:GridView>
    <div id="divBox" class="divBox" style="height:330px">
        <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td style="background-color: #990000; color: white">
                    <table cellpadding="0" cellspacing="0" width="100%" id="tblDrag">
                        <tr>
                            <td>
                                <span class="headerGird" style="font-size: 16px; font-family: Verdana; font-weight: bold"
                                    id="lblDialogVoter">KHO</span>
                                <input id="hidParaVoter" type="hidden" />
                            </td>
                            <td align="center" width="5%">
                                <img src="../../Images/Icon/close.png" width="25px" height="25px" boder="0" style="cursor: pointer"
                                    id="imgHideUV" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <iframe id="ifOrder" width="100%" height="300px" scrolling="auto" frameborder="0"></iframe>
                </td>
            </tr>
        </table>
    </div>
    <script language="javascript" type="text/javascript">
//        function fnUpdateQuantity(CodeID,StID,obj)
//        {
//            var Quantity=obj.parentNode.parentNode.cells[2].innerHTML;
//            if(parseInt(Quantity)>0)
//           {
//                var PDID=obj.getAttribute("PDID");
//                var iPageIndex='<%= iPageIndex%>'; 
//                window.location.href="InputProductStore.aspx?PDID="+PDID+"&StID="+StID+"&Type=0&CodeID="+CodeID+"&PageIndex="+iPageIndex;
//           }  
//        }
        
        
        $("#divBox").easydrag();
        $("#divBox").setHandler('tblDrag');                    
		function fnOpenOrderDetail(PDID,CodeID,StID,obj,type)
		{ 
		   $("#lblDialogVoter").text(type==1?"NHẬP KHO":type==0?"XUẤT KHO":"GIÁ GỐC");
		   var iPageIndex='<%= iPageIndex%>'; 
		   $("#ifOrder").attr({'src':'InputProductStore.aspx?PDID='+PDID+'&StID='+StID+'&Type='+type+'&CodeID='+CodeID+'&PageIndex='+iPageIndex});			    
		   $("#divBox").show(); 	
		   $("#ifOrder").height=$("#divBox").height;
		}
		 $('#imgHideUV').click(function() {                         
                HideEditBox();    
         });
         function HideEditBox() {       
           $("#ifOrder").attr({'src':''});	
            $("#divBox").hide();
         }
         function fnBindData(url)
         {
            HideEditBox();
            window.location.href=url;
         }
    </script>
</asp:Content>

